package com.easyj.admin.sys.serviceimpl;

import java.util.List;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.easyj.admin.sys.service.SysParamsService;
import com.easyj.admin.db.mapper.SysParamsMapper;
import com.easyj.base.exception.*;
import com.easyj.base.security.service.SecurityUtil;
import com.easyj.admin.db.model.SysParams;


@Service
public class SysParamsServiceImpl implements SysParamsService{
	
	@Autowired
	private  SysParamsMapper sysParamsMapper;
	

   	public List<SysParams> findList(SysParams filter){
        return sysParamsMapper.selectByExample(filter);
    }
	public long count(SysParams filter){
	     return sysParamsMapper.countByExample(filter);
	}	

	public SysParams findById(String id){
		SysParams entity= sysParamsMapper.selectByPrimaryKey(id);
		return entity;
	}
	

	
	@Transactional
	public int  updateEntity(SysParams entity) throws EasyjException{
	    entity.setModifyTime(new Date()); 
		entity.setOperatorId(SecurityUtil.getOperatorId());	
		int rtn= sysParamsMapper.updateByPrimaryKey(entity);
		return rtn;
	}

	


}
